<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String root = request.getContextPath();
	response.setHeader("expires","0");
%>
<html>
	<head>
		<title>My JSP 'admin_state.jsp' starting page</title>
		
		<link rel="stylesheet" type="text/css"
			href="<%=root%>/style/tablesorter/css/style.css" />
		<style type="text/css">
<!--
body {
	margin:0px;
	padding:0px;
}

.write_article_menu_item {
	background: transparent url(<%=root%>/images/add.png) scroll no-repeat
		left top;
	padding-top: 6px;
	padding-left: 8px;
}

.delete_article_menu_item {
	background: transparent url(<%=root%>/images/delete.png) scroll
		no-repeat left top;
	padding-top: 6px;
	padding-left: 8px;
}

.search_article_menu_item {
	background: transparent url(<%=root%>/images/search.gif) scroll
		no-repeat left top;
	padding-top: 6px;
	padding-left: 8px;
}

.refresh_article_menu_item {
	background: transparent url(<%=root%>/images/refresh.png) scroll
		no-repeat left top;
	padding-top: 6px;
	padding-left: 8px;
}

.search_article {
	background: transparent url(<%=root%>/images/search.gif) scroll
		no-repeat left top;
	padding-top: 6px;
	padding-left: 8px;
}

.modify_article {
	background: transparent url(<%=root%>/images/pen_modify.gif) scroll
		no-repeat left top;
	padding-left: 20px;
	height:20px;
	width:20px;
}

.pageNumber a {
	border: 1px SOLID #cccccc;
	padding: 1px 4px 1px 4px;
	margin-right: 4px;
	margin-top: 2px;
	font-size:12px;
	margin-bottom: 2px;
	display: block;
	background-color:#e6EEEE;
	float: left;
	color:#777777
}

.pageNumber a:hover {
	background-color: #d8f2f8;
	font-weight: bold;
	background-color:#8dbdd8;
	color:#ffffff
}

.pageNumber a:visited {
	text-decoration:none;
	color:#777777
}

#articles_grid{
	margin-top:0px;
}

.toolbar {
	background-color:#e6EEEE;
	margin-bottom:0px;
	width:100%;
	border-bottom:1px SOLID #333333;
}
.toolbar .menu {
	margin-top:8px;
	margin-left:0px;
	margin-bottom:5px;
}
.toolbar .menu li{
	display:inline;
	margin-left:10px;
	font-size:12px;
	padding-left:20px;
	text-decoration:none;
	border-right:1px SOLID #888888;
}
.toolbar .menu li a:hover{
	font-weight:BOLD;
	color:#000000;
}

.toolbar .menu li a{
	text-decoration:none;
	color:#000000;
}

.toolbar .menu li a:visited{
	text-decoration:none;
	color:#000000;
}

#articles_grid a:hover,a:visited,a {
	text-decoration:none;
	color:#8e8e8e;
}

#articles_grid a:hover{
	position:relative;
	top:1px;
	left:1px;
	color:#333333;
}
-->
</style>
		<script type="text/javascript"
			src="<%=root%>/scripts/jquery-1.3.2.min.js"></script>
		<script type="text/javascript" src="<%=root%>/scripts/flexigrid.js"></script>
		<script type="text/javascript" src="<%=root%>/scripts/jquery-latest.js"></script>
		<script type="text/javascript" src="<%=root%>/scripts/jquery.tablesorter.min.js"></script>
		<script type="text/javascript" src="<%=root%>/scripts/jquery.ckking.js"></script>
		
		<script type="text/javascript">
		<!--
		$(function(){
		
			var Article={
				writeArticle:function(){
					window.location="<%=root%>/admin/admin_write_article.jsp";
				},
				deleteArticle:function(){
					alert('delete article');
				},
				searchArticle:function(){
					alert('searchArticle');
				},
				modifyArticle:function(){
					alert('searchArticle');
				},
				refreshArticle:function(){
					alert('refreshArticle');
				}
			};
			
			
			$("#articles_grid").tablesorter({headers:{0:{sorter:false}}} );
			/*
			var bodyWidth=$("body").width();
			$("#flex1").flexigrid
			(
			{
			sortname: "wroteDate",
			striped: true,
			sortorder: "asc",
			usepager: false,
			title: '文章管理',
			buttons:[{name:'写新文章',bclass:'write_article',onpress:Article.writeArticle},{separator: true}
			,{name:'删除文章',bclass:'delete_article',onpress:Article.deleteArticle},{separator: true},{name:'查找文章',bclass:'search_article',onpress:Article.searchArticle}
			,{separator: true},{name:'刷新',bclass:'refresh_article',onpress:Article.refreshArticle}],
			showTableToggleBtn: true,
			height:'auto',
			width: bodyWidth
			}
			);
			
			*/
			function PageLocation(){
		  		function getRootWindow(self){
		  		 var parentWin=self.parent;
		  		 return parentWin;
		  		}
		  		
		  		this.location=function(url){
		  		 var rootWin=getRootWindow(window);
		  		 rootWin.location.href=url;
		  		}
	  		}
	  		
			$('#chking').accession();
		});
		
			function PageLocation(url){
			  		function getRootWindow(self){
			  		 var parentWin=self.parent;
			  		 return parentWin;
			  		}
			  		
			  		this.location=function(url){
			  		 var rootWin=getRootWindow(window);
			  		 rootWin.location.href=url;
			  		}
			  		
		  	}
		  	
		  	function to(id){
		  		var url="<%=root%>/system/articleRead.action?readArticle="+id;
		  		new PageLocation().location(url);
		  	}
		-->
		</script>
	</head>

	<body>	
		<form action="/admin/articleDelete.action" method="post" id="articles_form">
		<div class="toolbar">
			<ul class="menu">
				<li class="write_article_menu_item"><a href="<%=root%>/admin/articleReadyWrite.action">发表新文章</a></li>
				<li class="delete_article_menu_item"><a href="javascript:$('#articles_form').submit();">删除</a></li>
				<li class="refresh_article_menu_item"><a href="###">刷新</a></li>
			</ul>
		</div>
		<div class="articles_display">
			<table id="articles_grid" class="tablesorter" border="0" cellpadding="0" cellspacing="0">
				<thead>
					<th width="20">
						<input type='checkbox' id="chking" />
					</th>
					<th width="150">
						文章名
					</th>
					<th width="60">
						类别
					</th>
					<th width="70">
						发表日期
					</th>
					<th width="70">
						修改日期
					</th>
					<th width="70">
						评论数
					</th>
					<th width="50">
						置顶
					</th>
					<th width="80">
						创作类型
					</th>
					<th width="80">
						阅读次数
					</th>
					<th>
						动作
					</th>
				</thead>
				<tbody>
					<s:iterator value="articlePageData.pageData" id="article"
						status="status">
						<tr>
							<td>
								<input type='checkbox' class="slave" name='deletedArticles' value='<s:property value="#article.id" />'/>
							</td>
							<td>
								<a href="javascript:;" onclick="to('<s:property value="#article.id" />');"><s:property value="#article.title"/></a>
							</td>
							<td>
								<s:property value="#article.catogoryName"/>
							</td>
							<td>
								<s:date name="#article.writeDate" format="yyyy-mm-dd HH:MM"/>
							</td>
							<td>
								<s:date name="#article.editedDate" format="yyyy-mm-dd HH:MM"/>
							</td>
							<td>
								5
							</td>
							<td>
								<s:property value="#article.isTop"/>
							</td>
							<td>
								<s:property value="#article.type"/>
							</td>
							<td>
								<s:property value="#article.getReadCount()"/>
							</td>
							<td>
								<a class="modify_article">
								<a href="<%=root%>/admin/modifyArticle.action" class="modify_article"></a>
							</td>
						</tr>
					</s:iterator>
				</tbody>
			</table>
		</div>
		</form>
		<div class="pageNumber">
			<a  href="###">page <s:property value="articlePageData.pageIndex"/> of <s:property value="articlePageData.totalPage"/></a>
			<a  href="###">首页</a>
			<a  href="###">末页</a>
		</div>
	</body>
</html>
